package com.glsc.ngateway.platform.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.glsc.ngateway.platform.domain.costallocation.DepCostAllocation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author guoj
 * @description: 成本分摊-系统信息+分摊比例
 * @date 2024/7/19 10:26
 */
@Data
@Builder
@AllArgsConstructor
@ToString
@NoArgsConstructor
@ApiModel("新增系统信息dto")
public class BusiSystemInfoDto implements Serializable {
    private static final long serialVersionUID = -7934123424178694089L;
    @ApiModelProperty(value = "ID")
    private long id;
    @ApiModelProperty(value = "系统名称")
    private String systemName;
    @ApiModelProperty(value = "责任人")
    private String systemUserId;

    @ApiModelProperty(value = "系统大类")
    private String mainClass;

    @ApiModelProperty(value = "系统小类")
    private String systemClass;

    @ApiModelProperty(value = "操作人")
    private String operator;

    @Column(name = "dt_update_time", nullable = false, columnDefinition = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//json序列化实体类处理
    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;
    @ApiModelProperty(value = "分摊比例列表")
    private List<DepCostAllocation> depCostAllocationList;

    //只用于saveAllDep接口
    @ApiModelProperty(value = "分摊比例列表-全部门")
    private List<AllDepDto> allDepDtoList;
}
